﻿namespace HRM.CORE
{

    using APP.HELPER.Data.Helper;
    using Extra.ERP;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;

    public class HRM_PROCESS_SALARY
    {
        private DateTime m_Date;
        private string m_DecideNumber;
        private string m_EmployeeCode;
        private decimal m_NewBasicSalary;
        private double m_NewCoefficientSalary;
        private decimal m_NewInsuranceSalary;
        private decimal m_NewMinimumSalary;
        private int m_NewPayForm;
        private decimal m_NewPayMoney;
        private string m_NewRankSalary;
        private int m_NewStepSalary;
        private decimal m_OldBasicSalary;
        private double m_OldCoefficientSalary;
        private decimal m_OldInsuranceSalary;
        private decimal m_OldMinimumSalary;
        private int m_OldPayForm;
        private decimal m_OldPayMoney;
        private string m_OldRankSalary;
        private int m_OldStepSalary;
        private string m_Person;
        private string m_Reason;
        private Guid m_SalaryID;

        public HRM_PROCESS_SALARY()
        {
            this.m_SalaryID = Guid.Empty;
            this.m_EmployeeCode = "";
            this.m_OldPayForm = 0;
            this.m_OldPayMoney = 0M;
            this.m_OldRankSalary = "";
            this.m_OldStepSalary = 0;
            this.m_OldCoefficientSalary = 0.0;
            this.m_OldMinimumSalary = 0M;
            this.m_OldBasicSalary = 0M;
            this.m_OldInsuranceSalary = 0M;
            this.m_NewPayForm = 0;
            this.m_NewPayMoney = 0M;
            this.m_NewRankSalary = "";
            this.m_NewStepSalary = 0;
            this.m_NewCoefficientSalary = 0.0;
            this.m_NewMinimumSalary = 0M;
            this.m_NewBasicSalary = 0M;
            this.m_NewInsuranceSalary = 0M;
            this.m_Date = DateTime.Now;
            this.m_Reason = "";
            this.m_DecideNumber = "";
            this.m_Person = "";
        }

        public HRM_PROCESS_SALARY(Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            this.m_SalaryID = SalaryID;
            this.m_EmployeeCode = EmployeeCode;
            this.m_OldPayForm = OldPayForm;
            this.m_OldPayMoney = OldPayMoney;
            this.m_OldRankSalary = OldRankSalary;
            this.m_OldStepSalary = OldStepSalary;
            this.m_OldCoefficientSalary = OldCoefficientSalary;
            this.m_OldMinimumSalary = OldMinimumSalary;
            this.m_OldBasicSalary = OldBasicSalary;
            this.m_OldInsuranceSalary = OldInsuranceSalary;
            this.m_NewPayForm = NewPayForm;
            this.m_NewPayMoney = NewPayMoney;
            this.m_NewRankSalary = NewRankSalary;
            this.m_NewStepSalary = NewStepSalary;
            this.m_NewCoefficientSalary = NewCoefficientSalary;
            this.m_NewMinimumSalary = NewMinimumSalary;
            this.m_NewBasicSalary = NewBasicSalary;
            this.m_NewInsuranceSalary = NewInsuranceSalary;
            this.m_Date = Date;
            this.m_Reason = Reason;
            this.m_DecideNumber = DecideNumber;
            this.m_Person = Person;
        }

        public string Delete()
        {
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { this.m_SalaryID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PROCESS_SALARY_Delete", myParams, myValues);
        }

        public string Delete(Guid SalaryID)
        {
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PROCESS_SALARY_Delete", myParams, myValues);
        }

        public string Delete(SqlConnection myConnection, Guid SalaryID)
        {
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PROCESS_SALARY_Delete", myParams, myValues);
        }

        public string Delete(SqlTransaction myTransaction, Guid SalaryID)
        {
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PROCESS_SALARY_Delete", myParams, myValues);
        }

        public bool Exist(Guid SalaryID)
        {
            bool hasRows = false;
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PROCESS_SALARY_Get", myParams, myValues);
            if (reader != null)
            {
                hasRows = reader.HasRows;
                reader.Close();
                helper.Close();
                reader = null;
            }
            return hasRows;
        }

        public string Get(Guid SalaryID)
        {
            string str = "";
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PROCESS_SALARY_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_SalaryID = reader.GetGuid(reader.GetOrdinal("SalaryID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_OldPayForm = Convert.ToInt32(reader["OldPayForm"]);
                    this.m_OldPayMoney = Convert.ToDecimal(reader["OldPayMoney"]);
                    this.m_OldRankSalary = Convert.ToString(reader["OldRankSalary"]);
                    this.m_OldStepSalary = Convert.ToInt32(reader["OldStepSalary"]);
                    this.m_OldCoefficientSalary = Convert.ToDouble(reader["OldCoefficientSalary"]);
                    this.m_OldMinimumSalary = Convert.ToDecimal(reader["OldMinimumSalary"]);
                    this.m_OldBasicSalary = Convert.ToDecimal(reader["OldBasicSalary"]);
                    this.m_OldInsuranceSalary = Convert.ToDecimal(reader["OldInsuranceSalary"]);
                    this.m_NewPayForm = Convert.ToInt32(reader["NewPayForm"]);
                    this.m_NewPayMoney = Convert.ToDecimal(reader["NewPayMoney"]);
                    this.m_NewRankSalary = Convert.ToString(reader["NewRankSalary"]);
                    this.m_NewStepSalary = Convert.ToInt32(reader["NewStepSalary"]);
                    this.m_NewCoefficientSalary = Convert.ToDouble(reader["NewCoefficientSalary"]);
                    this.m_NewMinimumSalary = Convert.ToDecimal(reader["NewMinimumSalary"]);
                    this.m_NewBasicSalary = Convert.ToDecimal(reader["NewBasicSalary"]);
                    this.m_NewInsuranceSalary = Convert.ToDecimal(reader["NewInsuranceSalary"]);
                    this.m_Date = Convert.ToDateTime(reader["Date"]);
                    this.m_Reason = Convert.ToString(reader["Reason"]);
                    this.m_DecideNumber = Convert.ToString(reader["DecideNumber"]);
                    this.m_Person = Convert.ToString(reader["Person"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlConnection myConnection, Guid SalaryID)
        {
            string str = "";
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myConnection, "HRM_PROCESS_SALARY_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_SalaryID = reader.GetGuid(reader.GetOrdinal("SalaryID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_OldPayForm = Convert.ToInt32(reader["OldPayForm"]);
                    this.m_OldPayMoney = Convert.ToDecimal(reader["OldPayMoney"]);
                    this.m_OldRankSalary = Convert.ToString(reader["OldRankSalary"]);
                    this.m_OldStepSalary = Convert.ToInt32(reader["OldStepSalary"]);
                    this.m_OldCoefficientSalary = Convert.ToDouble(reader["OldCoefficientSalary"]);
                    this.m_OldMinimumSalary = Convert.ToDecimal(reader["OldMinimumSalary"]);
                    this.m_OldBasicSalary = Convert.ToDecimal(reader["OldBasicSalary"]);
                    this.m_OldInsuranceSalary = Convert.ToDecimal(reader["OldInsuranceSalary"]);
                    this.m_NewPayForm = Convert.ToInt32(reader["NewPayForm"]);
                    this.m_NewPayMoney = Convert.ToDecimal(reader["NewPayMoney"]);
                    this.m_NewRankSalary = Convert.ToString(reader["NewRankSalary"]);
                    this.m_NewStepSalary = Convert.ToInt32(reader["NewStepSalary"]);
                    this.m_NewCoefficientSalary = Convert.ToDouble(reader["NewCoefficientSalary"]);
                    this.m_NewMinimumSalary = Convert.ToDecimal(reader["NewMinimumSalary"]);
                    this.m_NewBasicSalary = Convert.ToDecimal(reader["NewBasicSalary"]);
                    this.m_NewInsuranceSalary = Convert.ToDecimal(reader["NewInsuranceSalary"]);
                    this.m_Date = Convert.ToDateTime(reader["Date"]);
                    this.m_Reason = Convert.ToString(reader["Reason"]);
                    this.m_DecideNumber = Convert.ToString(reader["DecideNumber"]);
                    this.m_Person = Convert.ToString(reader["Person"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlTransaction myTransaction, Guid SalaryID)
        {
            string str = "";
            string[] myParams = new string[] { "@SalaryID" };
            object[] myValues = new object[] { SalaryID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myTransaction, "HRM_PROCESS_SALARY_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_SalaryID = reader.GetGuid(reader.GetOrdinal("SalaryID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_OldPayForm = Convert.ToInt32(reader["OldPayForm"]);
                    this.m_OldPayMoney = Convert.ToDecimal(reader["OldPayMoney"]);
                    this.m_OldRankSalary = Convert.ToString(reader["OldRankSalary"]);
                    this.m_OldStepSalary = Convert.ToInt32(reader["OldStepSalary"]);
                    this.m_OldCoefficientSalary = Convert.ToDouble(reader["OldCoefficientSalary"]);
                    this.m_OldMinimumSalary = Convert.ToDecimal(reader["OldMinimumSalary"]);
                    this.m_OldBasicSalary = Convert.ToDecimal(reader["OldBasicSalary"]);
                    this.m_OldInsuranceSalary = Convert.ToDecimal(reader["OldInsuranceSalary"]);
                    this.m_NewPayForm = Convert.ToInt32(reader["NewPayForm"]);
                    this.m_NewPayMoney = Convert.ToDecimal(reader["NewPayMoney"]);
                    this.m_NewRankSalary = Convert.ToString(reader["NewRankSalary"]);
                    this.m_NewStepSalary = Convert.ToInt32(reader["NewStepSalary"]);
                    this.m_NewCoefficientSalary = Convert.ToDouble(reader["NewCoefficientSalary"]);
                    this.m_NewMinimumSalary = Convert.ToDecimal(reader["NewMinimumSalary"]);
                    this.m_NewBasicSalary = Convert.ToDecimal(reader["NewBasicSalary"]);
                    this.m_NewInsuranceSalary = Convert.ToDecimal(reader["NewInsuranceSalary"]);
                    this.m_Date = Convert.ToDateTime(reader["Date"]);
                    this.m_Reason = Convert.ToString(reader["Reason"]);
                    this.m_DecideNumber = Convert.ToString(reader["DecideNumber"]);
                    this.m_Person = Convert.ToString(reader["Person"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public DataTable GetAllList()
        {
            int level = MyLogin.Level;
            string code = MyLogin.Code;
            string[] myParams = new string[] { "@Level", "@Code" };
            object[] myValues = new object[] { level, code };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PROCESS_SALARY_GetAllList", myParams, myValues);
        }

        public DataTable GetAllListByDays(DateTime BeginDate, DateTime EndDate)
        {
            int level = MyLogin.Level;
            string code = MyLogin.Code;
            string[] myParams = new string[] { "@Level", "@Code", "@BeginDate", "@EndDate" };
            object[] myValues = new object[] { level, code, BeginDate, EndDate };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PROCESS_SALARY_GetAllListByDays", myParams, myValues);
        }

        public DataTable GetList()
        {
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PROCESS_SALARY_GetList");
        }

        public DataTable GetListByDays(string EmployeeCode, DateTime BeginDate, DateTime EndDate)
        {
            string[] myParams = new string[] { "@EmployeeCode", "@BeginDate", "@EndDate" };
            object[] myValues = new object[] { EmployeeCode, BeginDate, EndDate };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PROCESS_SALARY_GetListByDays", myParams, myValues);
        }

        public DataTable GetListByEmployee(string EmployeeCode)
        {
            string[] myParams = new string[] { "@EmployeeCode" };
            object[] myValues = new object[] { EmployeeCode };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PROCESS_SALARY_GetListByEmployee", myParams, myValues);
        }

        public DataTable GetListByMonth(string EmployeeCode, int Month, int Year)
        {
            string[] myParams = new string[] { "@EmployeeCode", "@Month", "@Year" };
            object[] myValues = new object[] { EmployeeCode, Month, Year };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PROCESS_SALARY_GetListByMonth", myParams, myValues);
        }

        public string Insert()
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                this.m_SalaryID, this.m_EmployeeCode, this.m_OldPayForm, this.m_OldPayMoney, this.m_OldRankSalary, this.m_OldStepSalary, this.m_OldCoefficientSalary, this.m_OldMinimumSalary, this.m_OldBasicSalary, this.m_OldInsuranceSalary, this.m_NewPayForm, this.m_NewPayMoney, this.m_NewRankSalary, this.m_NewStepSalary, this.m_NewCoefficientSalary, this.m_NewMinimumSalary, 
                this.m_NewBasicSalary, this.m_NewInsuranceSalary, this.m_Date, this.m_Reason, this.m_DecideNumber, this.m_Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PROCESS_SALARY_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                this.m_SalaryID, this.m_EmployeeCode, this.m_OldPayForm, this.m_OldPayMoney, this.m_OldRankSalary, this.m_OldStepSalary, this.m_OldCoefficientSalary, this.m_OldMinimumSalary, this.m_OldBasicSalary, this.m_OldInsuranceSalary, this.m_NewPayForm, this.m_NewPayMoney, this.m_NewRankSalary, this.m_NewStepSalary, this.m_NewCoefficientSalary, this.m_NewMinimumSalary, 
                this.m_NewBasicSalary, this.m_NewInsuranceSalary, this.m_Date, this.m_Reason, this.m_DecideNumber, this.m_Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PROCESS_SALARY_Insert", myParams, myValues);
        }

        public string Insert(Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                SalaryID, EmployeeCode, OldPayForm, OldPayMoney, OldRankSalary, OldStepSalary, OldCoefficientSalary, OldMinimumSalary, OldBasicSalary, OldInsuranceSalary, NewPayForm, NewPayMoney, NewRankSalary, NewStepSalary, NewCoefficientSalary, NewMinimumSalary, 
                NewBasicSalary, NewInsuranceSalary, Date, Reason, DecideNumber, Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PROCESS_SALARY_Insert", myParams, myValues);
        }

        public string Insert(SqlConnection myConnection, Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                SalaryID, EmployeeCode, OldPayForm, OldPayMoney, OldRankSalary, OldStepSalary, OldCoefficientSalary, OldMinimumSalary, OldBasicSalary, OldInsuranceSalary, NewPayForm, NewPayMoney, NewRankSalary, NewStepSalary, NewCoefficientSalary, NewMinimumSalary, 
                NewBasicSalary, NewInsuranceSalary, Date, Reason, DecideNumber, Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PROCESS_SALARY_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction, Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                SalaryID, EmployeeCode, OldPayForm, OldPayMoney, OldRankSalary, OldStepSalary, OldCoefficientSalary, OldMinimumSalary, OldBasicSalary, OldInsuranceSalary, NewPayForm, NewPayMoney, NewRankSalary, NewStepSalary, NewCoefficientSalary, NewMinimumSalary, 
                NewBasicSalary, NewInsuranceSalary, Date, Reason, DecideNumber, Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PROCESS_SALARY_Insert", myParams, myValues);
        }

        public string NewID()
        {
            return SqlHelper.GenCode("HRM_PROCESS_SALARY", "JobCode", "CV");
        }

        public string Update()
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                this.m_SalaryID, this.m_EmployeeCode, this.m_OldPayForm, this.m_OldPayMoney, this.m_OldRankSalary, this.m_OldStepSalary, this.m_OldCoefficientSalary, this.m_OldMinimumSalary, this.m_OldBasicSalary, this.m_OldInsuranceSalary, this.m_NewPayForm, this.m_NewPayMoney, this.m_NewRankSalary, this.m_NewStepSalary, this.m_NewCoefficientSalary, this.m_NewMinimumSalary, 
                this.m_NewBasicSalary, this.m_NewInsuranceSalary, this.m_Date, this.m_Reason, this.m_DecideNumber, this.m_Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PROCESS_SALARY_Update", myParams, myValues);
        }

        public string Update(Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                SalaryID, EmployeeCode, OldPayForm, OldPayMoney, OldRankSalary, OldStepSalary, OldCoefficientSalary, OldMinimumSalary, OldBasicSalary, OldInsuranceSalary, NewPayForm, NewPayMoney, NewRankSalary, NewStepSalary, NewCoefficientSalary, NewMinimumSalary, 
                NewBasicSalary, NewInsuranceSalary, Date, Reason, DecideNumber, Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PROCESS_SALARY_Update", myParams, myValues);
        }

        public string Update(SqlConnection myConnection, Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                SalaryID, EmployeeCode, OldPayForm, OldPayMoney, OldRankSalary, OldStepSalary, OldCoefficientSalary, OldMinimumSalary, OldBasicSalary, OldInsuranceSalary, NewPayForm, NewPayMoney, NewRankSalary, NewStepSalary, NewCoefficientSalary, NewMinimumSalary, 
                NewBasicSalary, NewInsuranceSalary, Date, Reason, DecideNumber, Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PROCESS_SALARY_Update", myParams, myValues);
        }

        public string Update(SqlTransaction myTransaction, Guid SalaryID, string EmployeeCode, int OldPayForm, decimal OldPayMoney, string OldRankSalary, int OldStepSalary, double OldCoefficientSalary, decimal OldMinimumSalary, decimal OldBasicSalary, decimal OldInsuranceSalary, int NewPayForm, decimal NewPayMoney, string NewRankSalary, int NewStepSalary, double NewCoefficientSalary, decimal NewMinimumSalary, decimal NewBasicSalary, decimal NewInsuranceSalary, DateTime Date, string Reason, string DecideNumber, string Person)
        {
            string[] myParams = new string[] { 
                "@SalaryID", "@EmployeeCode", "@OldPayForm", "@OldPayMoney", "@OldRankSalary", "@OldStepSalary", "@OldCoefficientSalary", "@OldMinimumSalary", "@OldBasicSalary", "@OldInsuranceSalary", "@NewPayForm", "@NewPayMoney", "@NewRankSalary", "@NewStepSalary", "@NewCoefficientSalary", "@NewMinimumSalary", 
                "@NewBasicSalary", "@NewInsuranceSalary", "@Date", "@Reason", "@DecideNumber", "@Person"
             };
            object[] myValues = new object[] { 
                SalaryID, EmployeeCode, OldPayForm, OldPayMoney, OldRankSalary, OldStepSalary, OldCoefficientSalary, OldMinimumSalary, OldBasicSalary, OldInsuranceSalary, NewPayForm, NewPayMoney, NewRankSalary, NewStepSalary, NewCoefficientSalary, NewMinimumSalary, 
                NewBasicSalary, NewInsuranceSalary, Date, Reason, DecideNumber, Person
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PROCESS_SALARY_Update", myParams, myValues);
        }

        [Category("Column"), DisplayName("Date")]
        public DateTime Date
        {
            get
            {
                return this.m_Date;
            }
            set
            {
                this.m_Date = value;
            }
        }

        [DisplayName("DecideNumber"), Category("Column")]
        public string DecideNumber
        {
            get
            {
                return this.m_DecideNumber;
            }
            set
            {
                this.m_DecideNumber = value;
            }
        }

        [DisplayName("EmployeeCode"), Category("Column")]
        public string EmployeeCode
        {
            get
            {
                return this.m_EmployeeCode;
            }
            set
            {
                this.m_EmployeeCode = value;
            }
        }

        [DisplayName("NewBasicSalary"), Category("Column")]
        public decimal NewBasicSalary
        {
            get
            {
                return this.m_NewBasicSalary;
            }
            set
            {
                this.m_NewBasicSalary = value;
            }
        }

        [Category("Column"), DisplayName("NewCoefficientSalary")]
        public double NewCoefficientSalary
        {
            get
            {
                return this.m_NewCoefficientSalary;
            }
            set
            {
                this.m_NewCoefficientSalary = value;
            }
        }

        [Category("Column"), DisplayName("NewInsuranceSalary")]
        public decimal NewInsuranceSalary
        {
            get
            {
                return this.m_NewInsuranceSalary;
            }
            set
            {
                this.m_NewInsuranceSalary = value;
            }
        }

        [DisplayName("NewMinimumSalary"), Category("Column")]
        public decimal NewMinimumSalary
        {
            get
            {
                return this.m_NewMinimumSalary;
            }
            set
            {
                this.m_NewMinimumSalary = value;
            }
        }

        [DisplayName("NewPayForm"), Category("Column")]
        public int NewPayForm
        {
            get
            {
                return this.m_NewPayForm;
            }
            set
            {
                this.m_NewPayForm = value;
            }
        }

        [Category("Column"), DisplayName("NewPayMoney")]
        public decimal NewPayMoney
        {
            get
            {
                return this.m_NewPayMoney;
            }
            set
            {
                this.m_NewPayMoney = value;
            }
        }

        [DisplayName("NewRankSalary"), Category("Column")]
        public string NewRankSalary
        {
            get
            {
                return this.m_NewRankSalary;
            }
            set
            {
                this.m_NewRankSalary = value;
            }
        }

        [DisplayName("NewStepSalary"), Category("Column")]
        public int NewStepSalary
        {
            get
            {
                return this.m_NewStepSalary;
            }
            set
            {
                this.m_NewStepSalary = value;
            }
        }

        [DisplayName("OldBasicSalary"), Category("Column")]
        public decimal OldBasicSalary
        {
            get
            {
                return this.m_OldBasicSalary;
            }
            set
            {
                this.m_OldBasicSalary = value;
            }
        }

        [Category("Column"), DisplayName("OldCoefficientSalary")]
        public double OldCoefficientSalary
        {
            get
            {
                return this.m_OldCoefficientSalary;
            }
            set
            {
                this.m_OldCoefficientSalary = value;
            }
        }

        [Category("Column"), DisplayName("OldInsuranceSalary")]
        public decimal OldInsuranceSalary
        {
            get
            {
                return this.m_OldInsuranceSalary;
            }
            set
            {
                this.m_OldInsuranceSalary = value;
            }
        }

        [Category("Column"), DisplayName("OldMinimumSalary")]
        public decimal OldMinimumSalary
        {
            get
            {
                return this.m_OldMinimumSalary;
            }
            set
            {
                this.m_OldMinimumSalary = value;
            }
        }

        [DisplayName("OldPayForm"), Category("Column")]
        public int OldPayForm
        {
            get
            {
                return this.m_OldPayForm;
            }
            set
            {
                this.m_OldPayForm = value;
            }
        }

        [Category("Column"), DisplayName("OldPayMoney")]
        public decimal OldPayMoney
        {
            get
            {
                return this.m_OldPayMoney;
            }
            set
            {
                this.m_OldPayMoney = value;
            }
        }

        [DisplayName("OldRankSalary"), Category("Column")]
        public string OldRankSalary
        {
            get
            {
                return this.m_OldRankSalary;
            }
            set
            {
                this.m_OldRankSalary = value;
            }
        }

        [DisplayName("OldStepSalary"), Category("Column")]
        public int OldStepSalary
        {
            get
            {
                return this.m_OldStepSalary;
            }
            set
            {
                this.m_OldStepSalary = value;
            }
        }

        [DisplayName("Person"), Category("Column")]
        public string Person
        {
            get
            {
                return this.m_Person;
            }
            set
            {
                this.m_Person = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class HRM_PROCESS_SALARY";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        [Category("Column"), DisplayName("Reason")]
        public string Reason
        {
            get
            {
                return this.m_Reason;
            }
            set
            {
                this.m_Reason = value;
            }
        }

        [DisplayName("SalaryID"), Category("Primary Key")]
        public Guid SalaryID
        {
            get
            {
                return this.m_SalaryID;
            }
            set
            {
                this.m_SalaryID = value;
            }
        }
    }
}

